package vfs.filter;

/**
 * The VFSAttributeConstraint class represents a constraint on
 * a particular object's attribute when filtering objects.  A
 * collection of these constraints are contained within a VFSFilter.
 * 
 * @author Matthew Eavenson <durandal@uga.edu>
 */
public interface VFSAttributeConstraint {
    
    /**
     * Returns the attribute that this constraint is meant to
     * apply to.  There are currently no guarantees that the
     * attribute will be a valid attribute over a particular
     * object.
     * 
     * @return the attribute that this constraint applies to
     */
    String getAttribute();
    
    /**
     * Assigns an operator to this constraint, where the
     * operator is one of the enum VFSFilterOperator.
     * 
     * @param op operator that this constraint will apply
     */
    void setOperator( VFSFilter.VFSFilterOperator op );
    
    /**
     * Returns the operator that this constraint will apply
     * when used in a filter.
     * 
     * @return the operator that this constraint applies
     */
    VFSFilter.VFSFilterOperator getOperator();

    /**
     * Assigns a value for the constraint to test the attribute 
     * against.  Even if the value is numerical, it should still 
     * be entered in String form.
     * 
     * @param value the value that this constraint will test against
     */
    void setValue( String value );
    
    /**
     * Returns the value that this constraint will test the
     * object's attribute against.
     * 
     * @return the value that this constraint will test against
     */
    String getValue();

    /**
     * Sets an optional second value for range queries.
     * 
     * @param value the optional range value
     */
    void setRangeValue( String value );
    
    /**
     * Returns an optional second value for range queries.
     * 
     * @return the value that this constraint will test against
     */
    String getRangeValue();
    
}
